package com.ux.example
{
	import com.ux.control.SoundPlayer;
	
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	public class SoundPlayerTest extends Sprite
	{
		
		private var sndPlayer : SoundPlayer;
		
		public function SoundPlayerTest()
		{
			super();
			
			
			sndPlayer = new SoundPlayer( "../assets/bgSound.mp3" );
			sndPlayer.playSound();
			
			stage.addEventListener( MouseEvent.CLICK, onStageClick );
		}
		
		
		private function onStageClick( e:MouseEvent ):void 
		{
			if( SoundPlayer.PAUSE == sndPlayer.status )
			{
				sndPlayer.playSound();
			}
			else
			{
				sndPlayer.pauseSound();
			}
		}
	}
}